PROGNAME=
CFG=
OUTDIR=
INTDIR=
SDK=
LINKTYPE=
CFLAGS=
LDFLAGS=
RSCFLAGS=

# Set to 1 to allow the building using the DLL version of SNMPLIB.
ALLOW_DLL=1

!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE 
NULL=nul
!ENDIF 

ALL : ..\bin\$(OUTDIR)\snmpd.exe


CPP=cl.exe
CPP_PROJ=/I.. /I..\..\include $(CFLAGS)

{..\..\agent}.c{$(INTDIR)}.obj::
   $(CPP) $(CPP_PROJ) $<

{..\..\snmplib}.c{$(INTDIR)}.obj::
   $(CPP) $(CPP_PROJ) $<

RSC=rc.exe
LINK32=link.exe
LINK32_FLAGS=netsnmp.lib netsnmpagent.lib netsnmpmibs.lib advapi32.lib ws2_32.lib kernel32.lib user32.lib /nologo /subsystem:console /out:"..\bin\$(OUTDIR)/snmpd.exe" /libpath:"../lib/$(OUTDIR)"
LINK32_FLAGS=$(LINK32_FLAGS) /pdb:"../bin/$(OUTDIR)/snmpd.pdb" $(LDFLAGS)
LINK32_OBJS= \
	"$(INTDIR)\auto_nlist.obj" \
	"$(INTDIR)\kernel.obj" \
	"$(INTDIR)\snmpd.obj" \
	"$(INTDIR)\winservice.obj" \
	"$(INTDIR)\winservice.res"

CLEAN :
	-@for %f in ($(LINK32_OBJS)) do erase %%f
	-@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe"
	-@erase "..\bin\$(OUTDIR)\$(PROGNAME).exe.manifest"

"..\bin\$(OUTDIR)\$(PROGNAME).exe" : $(DEF_FILE) $(LINK32_OBJS)
!IF "$(LINKTYPE)" == "static" || "$(ALLOW_DLL)" == "1"
    $(LINK32) $(LINK32_FLAGS) $(LINK32_OBJS)
!ELSE	# Linktype check
	-@echo .
	-@echo Aborting build.  Applications can not be built using --linktype=dynamic
	-@echo .
!ENDIF

!IF "$(NO_EXTERNAL_DEPS)" != "1"
!IF EXISTS("snmpd.dep")
!INCLUDE "snmpd.dep"
!ELSE 
!MESSAGE Warning: cannot find "snmpd.dep"
!ENDIF 
!ENDIF 

"$(INTDIR)\winservice.res": ..\..\snmplib\winservice.rc
	$(RSC) $(RSCFLAGS) /fo$@ /i "..\..\snmplib" ..\..\snmplib\winservice.rc
